﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;

/// <summary>
/// NoAccess 的摘要说明
/// </summary>
public class NoAccess
{
	public NoAccess()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public static void JumpToDefaultPageNoAccessTime(Page page, string emId)
    {
        DataTable dt = Exam.getEmTimeByEmId(emId);
        if (dt.Rows.Count > 0)
        {
            DataRow dr = dt.Rows[0];
            DateTime startTime = DateTime.Parse(dr["ApplyBeginTime"].ToString());
            DateTime endTime = DateTime.Parse(dr["ApplyEndTime"].ToString());
            if (DateTime.Now < startTime || DateTime.Now > endTime)
            {
                page.Response.Redirect(BSUtility.mainUrl + "Default.aspx");
            }


        }
    }
}